﻿/*
 * @Author: Song Xinxin
 * @Date: 2022-11-03 15:09:48
 * @LastEditors: Song Xinxin
 * @LastEditTime: 2022-11-06 18:25:45
 * @FilePath: \WYW_0419_Oasis\JavaScripts\Modules\Game\Data_Game.ts
 * @Description: 
 * 
 * Copyright (c) 2022 by error: git config user.name && git config user.email & please set dead value or install git, All Rights Reserved. 
 */
import { DataInfo, ModuleData } from "odin";

export class DataInfo_Game extends DataInfo
{
    //玩家昵称
    NameRank:string[];
    //玩家击杀数排序
    KillRank:number[];
    //玩家死亡数排序
    DeathRank:number[];
    //玩家收集数排序
    CountRank:number[];
}

export class Data_Game extends ModuleData<DataInfo_Game>
{
    public constructor()
    {
        super(DataInfo_Game);
    }

    /**
     * 初始化数据
     */
    public initRank():void
    {
        this.dataInfo.NameRank = ["NULL"];
        this.dataInfo.KillRank = [0];
        this.dataInfo.DeathRank = [0];
        this.dataInfo.CountRank = [0];
    }

    /**
     * 获取玩家昵称排序
     */
    public get getNameRank()
    {
        return this.dataInfo.NameRank;
    }

    /**
     * 获取玩家击杀数排序
     */
    public get getKillRank()
    {
        return this.dataInfo.KillRank;
    }

    /**
     * 获取玩家死亡数排序
     */
    public get getDeathRank()
    {
        return this.dataInfo.DeathRank;
    }

    /**
     * 获取玩家收集数排序
     */
    public get getCountRank()
    {
        return this.dataInfo.CountRank;
    }

    /**设置玩家昵称排序
     * 
     * @param index 
     * @param name 
     */
    public setNameRank(index:number,name:string):void
    {
        this.dataInfo.NameRank[index] = name;
    }

    /**
     * 设置玩家击杀数排序
     * @param index 
     * @param kill 
     */
    public setKillRank(index:number,kill:number):void
    {
        this.dataInfo.KillRank[index] = kill;
    }

    /**
     * 设置玩家死亡数排序
     * @param index 
     * @param death 
     */
    public setDeathRank(index:number,death:number):void
    {
        this.dataInfo.DeathRank[index] = death;
    }

    /**
     * 设置玩家收集数排序
     * @param index 
     * @param count 
     */
    public setCountRank(index:number,count:number):void
    {
        this.dataInfo.CountRank[index] = count;
    }

}